<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>通用-服务产品新建/编辑</title>
        <link rel="stylesheet" type="text/css" href="<%request.getContextPath();%>/css/jquery.dataTables.css"/>
        <link rel="stylesheet" href="<%request.getContextPath();%>/css/bootstrap.min.css"/>
        <link rel="stylesheet" href="<%request.getContextPath();%>/css/commonStyle.css"/>
        <link rel="stylesheet" href="<%request.getContextPath();%>/css/Login.css">
        <style type="text/css" class="init"></style>
        <script src="<%request.getContextPath();%>/js/jquery-1.11.2.min.js"></script>
        <script src="<%request.getContextPath();%>/js/bootstrap.min.js"></script>
        <script type="text/javascript" src="<%request.getContextPath();%>/js/plus_more.js"></script>
        <script type="text/javascript" src="<%request.getContextPath();%>/js/jquery.dataTables.js"></script>
        <script type="text/javascript" language="javascript" class="init">
   			 $(document).ready(function() 
             {
                $('#example').dataTable();
				$("#name").blur(function(){
					var name=$.trim($("#name").val()); 
					if(name.length>18){
						$("#nameP").html("<span>&nbsp;最多18个汉字</span>")
										   .css("color","red"); 
					}
					else if(name.length<1){
						$("#nameP").html("<span>&nbsp;服务产品名称不能为空</span>")
										   .css("color","red"); 
					}
					else{
						$("#nameP").html("<span>最多18个汉字</span>")
										   .css("color","black"); 
						}
				});
				
				$("#price").blur(function(){
					var price=$.trim($("#price").text());
					if(price.length>500){
						$("#priceP").html("<span>&nbsp;不超过500个字</span>")
										   .css("color","red"); 
					}
				});
					

            } );
        </script>
    </head>

    <body>
    <div class="container">
    
<!--      页头-->
       <header>
           <h2><span id="title">通用服务产品信息新建/编辑</span></h2>
       </header>
       <hr>
        
        <article>
        <form class="form-horizontal" method="post" action="/add/general" enctype="multipart/form-data">
<!--        服务产品编号-->
            <c:forEach items="${generalServiceslist}" var="tag" varStatus="id">
          <div class="form-group">
            <label for="num" class="col-sm-2 control-label">服务产品编号</label>
            <div class="col-xs-4">
                <input name="generalserviceid" type="text" class="form-control" id="num" value="${tag.generalserviceid}">
            </div>
            <p class="help-inline" style="margin-top:8px;">系统自动分配，每个服务产品的唯一ID</p>
          </div>
<!--         服务产品名称-->
          <div class="form-group">
            <label for="name" class="col-sm-2 control-label">服务产品名称</label>
            <div class="col-xs-4">
                <input name="name" type="text" class="form-control" id="name" placeholder="*****" value="${tag.name}">
            </div>
            <p class="help-inline" style="margin-top:8px;" id="nameP">最多18个汉字</p>
          </div>
<!--         所属分类-->
          <div class="form-group">
            <label class="col-sm-2 control-label">所属分类</label>
            <div class="col-xs-4">
                <select name="category" id="kind" class="form-control">
                     <option selected value="1">法律服务</option>
                     <option value="2">会计服务</option>
                     <option value="3">税务服务</option>
                     <option value="4">人力资源服务</option>
                     <option value="5">后勤服务</option>
                     <option value="6">资金申报服务</option>
                     <option value="7">营销服务</option>
                     <option value="8">其他服务</option>
                 </select>
            </div>
          </div>
<!--          服务产品内容-->
          <div class="form-group">
            <label for="" class="col-sm-2 control-label">服务产品内容</label>
            <div class="col-sm-8">
               <textarea name="content" id="" class="form-control" rows="5">${tag.content}</textarea>
            </div>
          </div>
<!--          服务产品价格-->
          <div class="form-group">
            <label for="" class="col-sm-2 control-label">服务产品价格</label>
            <div class="col-sm-8">
               <textarea name="price" class="form-control" rows="5" placeholder="不超过500字">${tag.price}</textarea>
            </div>
          </div>
<!--          服务保障-->
          <div class="form-group">
            <label for="" class="col-sm-2 control-label">服务保障</label>
            <div class="col-sm-8">
               <textarea name="ensure" class="form-control" rows="5">${tag.ensure}</textarea>
            </div>
          </div> 

      
                       
<!--         公司logo-->
            <div class="form-group">
                <label class="col-sm-2 control-label">产品logo</label>
                <div id="uplogol_3" style="float:left; border:1px solid #999999; margin-left:14px;"><img id="showlogol_3" name="" src="images/Project-LOGO.png" class="other_pic_logo"/></div>
                <div style="float:left;">
                    <label for="surelogol_3" class="btn btn-primary submit_btn_img_p" style="margin-left:20px; margin-top:20px;" > +更换图片
                        <input name="files" type="file" onchange="previewImage(this,'uplogol_3','showlogol_3',120,120)" name="pic_submit" class="submit_btn" style="display:none;" id="surelogol_3" value="上传Logo"/>
                    </label>
                    <p class="Tab_he_2">规格：120✖120；</p>
                    <p class="Tab_he_3">格式：JPG；</p>
                </div>
            </div>
<!--          操作备注-->
          <div class="form-group">
            <label for="remark" class="col-sm-2 control-label">操作备注</label>
            <div class="col-sm-8">
               <textarea name="logContent" id="remark" class="form-control" rows="5"></textarea>
            </div>

          </div>
            </c:forEach>
<!--          按钮组-->
            <div class="buttongroup" style="width:970px; margin-left:0px; margin-top:0px;">
                <button type="button" class="btn btn-primary" id="contact_btn1">保存为草稿</button>
                <button type="button" class="btn btn-primary" id="contact_btn2">保存并上线</button>
                <button type="button" class="btn btn-primary" id="p_savenone" style="margin-left: 80px;width:100px;margin-top:13px;">取消</button>
            </div>
            <!-- 保存为草稿的弹窗 开始 -->
            <div id="Popups_savech" class="Popup_out_st">
                <div id="Con_box_savech" class="Popup_in_st">
                    <img src="../images/close.png" id="closePopups_savech" class="Close_Popups"/>
                    <label class="Popup_label">保存为草稿</label>
                    <hr class="Popup_in_hr"/>
                    <p class="Popup_in_p">保存修改内容？</p>
                    <button type="submit" class="btn btn-primary" id="Popups_saveyes" style="width: 60px;margin-left: 80px;margin-top: 8px;float: left;">是</button>
                    <button class="btn btn-primary" id="Popups_saveno" style="margin-left: 50px;margin-top: 8px;width: 60px;float: left;">否</button>
                </div>
            </div>
            <!-- 保存为草稿弹窗 结束 -->
            <!-- 保存并上线弹窗 开始 -->
            <div id="Popups_saveup" class="Popup_out_st">
                <div id="Con_box_saveup" class="Popup_in_st">
                    <img src="../images/close.png" id="closePopups_saveup" class="Close_Popups"/>
                    <label class="Popup_label">保存并上线</label>
                    <hr class="Popup_in_hr"/>
                    <p class="Popup_in_p">保存修改内容并发布上线？</p>
                    <button type="submit" class="btn btn-primary" id="Popups_saveupyse" style="width: 60px;margin-left: 80px;margin-top: 8px;float: left;">是</button>
                    <button class="btn btn-primary" id="Popups_saveupno" style="margin-left: 50px;margin-top: 8px;width: 60px;float: left;">否</button>
                </div>
            </div>
            <!-- 保存并上线弹窗 结束 -->
            <!-- 取消弹窗 开始 -->
            <div id="Popups_savenone" class="Popup_out_st">
                <div id="Con_box_savenone" class="Popup_in_st">
                    <img src="../images/close.png" id="closePopups_savenone" class="Close_Popups"/>
                    <label class="Popup_label">取消</label>
                    <hr class="Popup_in_hr"/>
                    <p class="Popup_in_p">确定放弃当前文案修改？</p>
                    <button type="reset" class="btn btn-primary" id="Popups_savenoneyse" style="width: 60px;margin-left: 80px;margin-top: 8px;float: left;">是</button>
                    <button class="btn btn-primary" id="Popups_savenoneno" style="margin-left: 50px;margin-top: 8px;width: 60px;float: left;">否</button>
                </div>
            </div>
            <!-- 取消弹窗 结束 -->
        </form>
        </article>
    </div>
    <script type="text/javascript">
        wdh=$(window).width();
        left=(wdh-330)/2;
        www=$(document).width();
        hhh=$(document).height();
        $(document).ready(function(){
            //保存为草稿
            $("#contact_btn1").click(function(){
                $("#Popups_savech").fadeIn("slow");
                $("#page_index").css('overflow','scroll');
                $("#page_index").css('overflow','hidden');
                $("#Con_box_savech").css('margin-left',left);
                $("#Con_box_savech").css('margin-top','800px');
            });
            $("#closePopups_savech").click(function(){
                $("#Popups_savech").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            $("#Popups_saveyes").click(function(){
                $("#Popups_savech").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            $("#Popups_saveno").click(function(){
                $("#Popups_savech").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            //保存并上线
            $("#contact_btn2").click(function(){
                $("#Popups_saveup").fadeIn("slow");
                $("#page_index").css('overflow','scroll');
                $("#page_index").css('overflow','hidden');
                $("#Con_box_saveup").css('margin-left',left);
                $("#Con_box_saveup").css('margin-top','800px');
            });
            $("#closePopups_saveup").click(function(){
                $("#Popups_saveup").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            $("#Popups_saveupyse").click(function(){
                $("#Popups_saveup").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            $("#Popups_saveupno").click(function(){
                $("#Popups_saveup").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            //取消
            $("#p_savenone").click(function(){
                $("#Popups_savenone").fadeIn("slow");
                $("#page_index").css('overflow','scroll');
                $("#page_index").css('overflow','hidden');
                $("#Con_box_savenone").css('margin-left',left);
                $("#Con_box_savenone").css('margin-top','800px');
            });
            $("#closePopups_savenone").click(function(){
                $("#Popups_savenone").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            $("#Popups_savenoneyse").click(function(){
                $("#Popups_savenone").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });

            $("#Popups_savenoneno").click(function(){
                $("#Popups_savenone").fadeOut("slow");
                $("#page_index").css('overflow-y','auto');
            });
            $("#page_index ").css('width',www);
        });
        $(window).resize(function(){
            wdh=$(window).width();
            left=(wdh-330)/2;
            www=$(document).width();
            //保存为草稿
            $("#Con_box_savech").css('margin-left',left);
            $("#Con_box_savech").css('margin-top','800px');
            //保存并上线
            $("#Con_box_saveup").css('margin-left',left);
            $("#Con_box_saveup").css('margin-top','800px');
            //取消
            $("#Con_box_savenone").css('margin-left',left);
            $("#Con_box_savenone").css('margin-top','800px');

            $("#page_index ").css('width',www);
        });
    </script>
    </body>
</html>